xen.git
14 years agox86/KEXEC: disable hpet legacy broadcasts earlier
Andrew Cooper [Fri, 19 Aug 2011 08:58:22 +0000 (09:58 +0100)]
x86/KEXEC: disable hpet legacy broadcasts earlier

On x2apic machines which booted in xapic mode,
hpet_disable_legacy_broadcast() sends an event check IPI to all online
processors.  This leads to a protection fault as the genapic blindly
pokes x2apic MSRs while the local apic is in xapic mode.

One option is to change genapic when we shut down the local apic, but
there are still problems with trying to IPI processors in the online
processor map which are actually sitting in NMI loops

Another option is to have each CPU take itself out of the online CPU
map during the NMI shootdown.

Realistically however, disabling hpet legacy broadcasts earlier in the
kexec path is the easiest fix to the problem.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
14 years agomini-os: work around ld bug causing stupid CTOR count
Jeremy Fitzhardinge [Fri, 19 Aug 2011 08:57:42 +0000 (09:57 +0100)]
mini-os: work around ld bug causing stupid CTOR count

I'm seeing pvgrub crashing when running CTORs.  It appears its because
the magic in the linker script is generating junk.  If I get ld to
output a map, I see:

.ctors          0x0000000000097000       0x18
                0x0000000000097000                __CTOR_LIST__ = .
                0x0000000000097000        0x4 LONG 0x25c04
                (((__CTOR_END__ - __CTOR_LIST__) / 0x4) - 0x2)
 *(.ctors)
 .ctors         0x0000000000097004       0x10
                /home/jeremy/hg/xen/unstable/stubdom/mini-os-x86_32-grub/mini-os.o
                0x0000000000097014        0x4 LONG 0x0
                0x0000000000097018                __CTOR_END__ = .

In other words, somehow ((0x97018-0x97000) / 4) - 2 = 0x25c04

The specific crash is that the ctor loop tries to call the NULL
sentinel.  I'm seeing the same with the DTOR list.

Avoid this by terminating the loop with the NULL sentinel, and get rid
of the CTOR count entirely.

From: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agox86-64/EFI: construct EDD data from device path protocol information
Jan Beulich [Fri, 19 Aug 2011 08:55:20 +0000 (09:55 +0100)]
x86-64/EFI: construct EDD data from device path protocol information

In the absence of a BIOS to handle INT13 requests, this information
must be constructed artificially instead when booted from EFI.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: trampoline cleanup
Jan Beulich [Fri, 19 Aug 2011 08:54:53 +0000 (09:54 +0100)]
x86: trampoline cleanup

To make future changes less error prone, and to slightly simplify a
possible future conversion to a relocatable trampoline even for the
multiboot path (pretty desirable given that we had to change the
trampoline base a number of times to escape collisions with firmware
placed data),
- remove final uses of bootsym_phys() from trampoline.S, allowing the
  symbol to be undefined before including this file (to make sure no
  new references get added)
- replace two easy to deal with uses of bootsym_phys() in head.S
- remove an easy to replace reference to BOOT_TRAMPOLINE

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: make run-time part of trampoline relocatable
Jan Beulich [Fri, 19 Aug 2011 08:54:26 +0000 (09:54 +0100)]
x86: make run-time part of trampoline relocatable

In order to eliminate an initial hack in the EFI boot code (where
memory for the trampoline was just "claimed" instead of properly
allocated), the trampoline code must no longer make assumption on the
address at which it would be located. For the time being, the fixed
address is being retained for the traditional multiboot path.

As an additional benefit (at least from my pov) it allows confining
the visibility of the BOOT_TRAMPOLINE definition to just the boot
code.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: simplify (and fix) clear_IO_APIC{,_pin}()
Jan Beulich [Tue, 16 Aug 2011 14:05:55 +0000 (15:05 +0100)]
x86: simplify (and fix) clear_IO_APIC{,_pin}()

These are used during bootup and (emergency) shutdown only, and their
only purpose is to get the actual IO-APIC's RTE(s) cleared.
Consequently, only the "raw" accessors should be used (and the ones
going through interrupt remapping code can be skipped), with the
exception of determining the delivery mode: This one must always go
through the interrupt remapping path, as in the VT-d case the actual
IO-APIC's RTE will have the delivery mode always set to zero (which
before possibly could have resulted in such an entry getting cleared
in the "raw" pass, though I haven't observed this case in practice).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agopassthrough: don't use open coded IO-APIC accesses
Jan Beulich [Tue, 16 Aug 2011 14:05:30 +0000 (15:05 +0100)]
passthrough: don't use open coded IO-APIC accesses

This makes the respective functions quite a bit more legible.

Since this requires fiddling with __ioapic_{read,write}_entry()
anyway,
make them and their wrappers have their argument types match those of
__io_apic_{read,write}() (int -> unsigned int).

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86-64/mmcfg: relax base address restriction
Jan Beulich [Tue, 16 Aug 2011 14:05:03 +0000 (15:05 +0100)]
x86-64/mmcfg: relax base address restriction

Following what Linux did quite a while ago, don't generally disallow
MMCFG base addresses to live above the 4Gb boundary: New systems are
assumed to be fine, and SGI ones are, too.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoRevert 23733:fbf3768e5934 "AMD IOMMU: remove global ..."
Ian Jackson [Tue, 16 Aug 2011 14:04:19 +0000 (15:04 +0100)]
Revert 23733:fbf3768e5934 "AMD IOMMU: remove global ..."

23733:fbf3768e5934 causes xen-unstable not to boot on several of the
xen.org AMD test systems.  We get an endless series of these:

  (XEN) AMD-Vi: IO_PAGE_FAULT: domain = 0, device id = 0x00a0, fault
  address = 0xfdf8f10144

I have constructed the attached patch which reverts c/s 23733
(adjusted for conflicts due to subsequent patches).  With this
reversion Xen once more boots on these machines.

23733 has been in the tree for some time now, causing this breakage,
and has already been fingered by the automatic bisector and discussed
on xen-devel as the cause of boot failures.  I think it is now time to
revert it pending a correct fix to the original problem.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoamd iommu: Automatic page coalescing
Wei Wang [Tue, 16 Aug 2011 14:03:11 +0000 (15:03 +0100)]
amd iommu: Automatic page coalescing

This patch implements automatic page coalescing when separated io page
table is used. It uses ignore bits in iommu pde to cache how many
entries lower next page level are suitable for coalescing and then
builds a super page entry when all lower entries are contiguous.  This
patch has been tested OK for weeks mainly with graphic devices and 3D
mark vantage.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
14 years agox86/PCI-MSI: properly determine VF BAR values
Jan Beulich [Sat, 13 Aug 2011 09:14:58 +0000 (10:14 +0100)]
x86/PCI-MSI: properly determine VF BAR values

As was discussed a couple of times on this list, SR-IOV virtual
functions have their BARs read as zero - the physical function's
SR-IOV capability structure must be consulted instead. The bogus
warnings people complained about are being eliminated with this
change.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: IRQ fix incorrect logic in __clear_irq_vector
Andrew Cooper [Sat, 13 Aug 2011 09:14:28 +0000 (10:14 +0100)]
x86: IRQ fix incorrect logic in __clear_irq_vector

In the old code, tmp_mask is the cpu_and of cfg->cpu_mask and
cpu_online_map.  However, in the usual case of moving an IRQ from one
PCPU to another because the scheduler decides its a good idea,
cfg->cpu_mask and cfg->old_cpu_mask do not intersect.  This causes the
old cpu vector_irq table to keep the irq reference when it shouldn't.

This leads to a resource leak if a domain is shut down wile an irq has
a move pending, which results in Xen's create_irq() eventually failing
with -ENOSPC when all vector_irq tables are full of stale references.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
14 years agox86/amd: Add support for read-only APERF/MPERF
Mark Langsdorf [Sat, 13 Aug 2011 09:13:38 +0000 (10:13 +0100)]
x86/amd: Add support for read-only APERF/MPERF

AMD is adding support for a read-only mode of the APERF
and MPERF MSRs. When this mode is enabled, writes to
these registers are ignored and do no reset the registers.
This allows multiple well-behaved programs to share the
use of the registers even if a poorly behaved program
attempts to reset them. Support for this feature is
indicated by a CPUID bit.

AMD has been recommending that well-behaved software
avoid resetting the APERF and MPERF MSRs. Enabling
this feature should not change the behavior of well-
behaved software. This change has been tested with the
turbostat and cpufreq-aperf applications.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
14 years agoVT-d: don't reject valid DMAR/ATSR tables on systems with multiple PCI segments
Jan Beulich [Sat, 13 Aug 2011 09:12:49 +0000 (10:12 +0100)]
VT-d: don't reject valid DMAR/ATSR tables on systems with multiple PCI segments

On multi-PCI-segment systems, each segment has to be expected to have
an include-all DRHD and an all-ports ATSR, so the firmware consistency
check incorrectly rejects valid configurations there (which is
particularly problematic when the firmware also pre-enabled x2apic
mode, as the system will panic in that case due to being unable to
enable interrupt remapping). Thus constrain the check to just segment
0 for now; once full multi-segment support is there (which I'm working
on), it can be revisited whether we'd want to track this per segment,
or whether we trust the firmware of such large systems.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoPassthrough: disable bus-mastering on any card that causes an IOMMU fault.
Tim Deegan [Fri, 12 Aug 2011 10:29:24 +0000 (11:29 +0100)]
Passthrough: disable bus-mastering on any card that causes an IOMMU fault.

This stops the card from raising back-to-back faults and live-locking
the CPU that handles them.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Wei Wang2 <wei.wang2@amd.com>
Acked-by: Allen M Kay <allen.m.kay@intel.com>
14 years agohvmloader: relicense hvmloader xenbus implementation under more
Ian Campbell [Wed, 10 Aug 2011 13:43:34 +0000 (14:43 +0100)]
hvmloader: relicense hvmloader xenbus implementation under more
liberal terms.

This code is a great example of a simple xenbus implementation and we
would like to reuse it in projects with non-GPLv2 license
(specifically in this case SeaBIOS which is GPLv3).

I picked the license from extras/mini-os/COPYING (A two clause BSD
style license) since mini-os exists for much the same purpose.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoACPI ERST: Revert change to erst_check_table() to be more permissive.
Keir Fraser [Tue, 9 Aug 2011 17:06:43 +0000 (18:06 +0100)]
ACPI ERST: Revert change to erst_check_table() to be more permissive.

Permits tables that apparently Xen cannot handle (causes boot failure
on many systems).

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoRevert 23757:f5176c177b99 "xenstored: allow guests to reintroduce themselves"
Ian Jackson [Tue, 9 Aug 2011 16:48:16 +0000 (17:48 +0100)]
Revert 23757:f5176c177b99 "xenstored: allow guests to reintroduce themselves"

This patch seems to have been applied by mistake, despite adverse
comments on the list and a lack of an appropriate ack.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agohvmloader: Move init_vm86_tss() back into common code.
Keir Fraser [Tue, 9 Aug 2011 10:33:40 +0000 (11:33 +0100)]
hvmloader: Move init_vm86_tss() back into common code.

It is not BIOS specific.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoxenstored: allow guests to reintroduce themselves
Olaf Hering [Tue, 9 Aug 2011 07:53:40 +0000 (08:53 +0100)]
xenstored: allow guests to reintroduce themselves

During kexec all old watches have to be removed, otherwise the new
kernel will receive unexpected events. Allow a guest to introduce
itself
and cleanup all of its watches.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
14 years agohvmloader: Enable SCI in QEMU has it disabled.
Keir Fraser [Thu, 28 Jul 2011 14:40:54 +0000 (15:40 +0100)]
hvmloader: Enable SCI in QEMU has it disabled.

When booting a Windows guest, the OS report an issue with the ACPI (in
a BSOD). The exact issue is "SCI_EN never becomes set in PM1 Control
Register." (quoted from WinDbg help).

So this patch enables the flags SCI_EN if it is not yet enabled.

Reported-by: Tobias Geiger <tobias.geiger@vido.info>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agox86/mm: Handle 1GiB superpages in the pagetable walker.
Tim Deegan [Thu, 28 Jul 2011 12:45:09 +0000 (13:45 +0100)]
x86/mm: Handle 1GiB superpages in the pagetable walker.

This allows HAP guests to use 1GiB superpages.  Shadow and PV guests
still can't use them without more support in shadow/* and mm.c.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoxen: AMD IOMMU: Automatically enable per-device vector maps
George Dunlap [Tue, 26 Jul 2011 17:37:32 +0000 (18:37 +0100)]
xen: AMD IOMMU: Automatically enable per-device vector maps

Automatically enable per-device vector maps when using IOMMU,
unless disabled specifically by an IOMMU parameter.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agoxen: Option to allow per-device vector maps for MSI IRQs
George Dunlap [Tue, 26 Jul 2011 17:37:16 +0000 (18:37 +0100)]
xen: Option to allow per-device vector maps for MSI IRQs

Add a vector-map to pci_dev, and add an option to point MSI-related
IRQs to the vector-map of the device.

This prevents irqs from the same device from being assigned
the same vector on different pcpus.  This is required for systems
using an AMD IOMMU, since the intremap tables on AMD only look at
vector, and not destination ID.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agoxen: Infrastructure to allow irqs to share vector maps
George Dunlap [Tue, 26 Jul 2011 17:36:58 +0000 (18:36 +0100)]
xen: Infrastructure to allow irqs to share vector maps

Laying the groundwork for per-device vector maps.  This generic
code allows any irq to point to a vector map; all irqs sharing the
same vector map will avoid sharing vectors.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agoNested VMX: fix error paths in emulation of VMLAUNCH and VMRESUME.
Tim Deegan [Tue, 26 Jul 2011 16:00:25 +0000 (17:00 +0100)]
Nested VMX: fix error paths in emulation of VMLAUNCH and VMRESUME.

These instructions don't fault on bad VMCS pointers, they set bits in
RFLAGS and continue execution.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoNested VMX: always mark VVMCS as not-launched on VMCLEAR.
Tim Deegan [Tue, 26 Jul 2011 16:00:24 +0000 (17:00 +0100)]
Nested VMX: always mark VVMCS as not-launched on VMCLEAR.

The SDM says to flush changes and clear the launch state even if this
isn't the "current VMCS".  KVM relies on this behaviour, so take the
warning printk away as well.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agox86-64/MMCFG: pass down firmware (ACPI) reservation status of used memory space
Jan Beulich [Mon, 25 Jul 2011 15:43:26 +0000 (16:43 +0100)]
x86-64/MMCFG: pass down firmware (ACPI) reservation status of used memory space

Reserving the MMCFG address range(s) in E820 is specified to only be
optional for the firmware to do. The requirement is to have them
reserved in ACPI resources. Those, however, aren't directly visible to
Xen as they require the ACPI interpreter to be active. Thus, if a
range isn't reserved in E820, we should not completely disable use of
MMCFG on the respective bus range, but rather keep it disabled until
Dom0 can pass down information on the ACPI reservation status (though
a new physdevop hypercall).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86-64/MMCFG: finally make Fam10 enabling work
Jan Beulich [Mon, 25 Jul 2011 15:42:53 +0000 (16:42 +0100)]
x86-64/MMCFG: finally make Fam10 enabling work

Forcibly enabling the MMCFG space on AMD Fam10 CPUs cannot be expected
to work since with the firmware not being aware of the address range
used it cannot possibly reserve the space in E820 or ACPI resources.
Hence we need to manually insert the range into the E820 table, and
enable the range only when the insertion actually works without
conflict.

Further, the actual enabling of the space is done from identify_cpu(),
which means that acpi_mmcfg_init() muts be called after that function
(and hance should not be called from acpi_boot_init()). Otherwise,
Dom0 would be able to use MMCFG, but Xen wouldn't.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86-64/MMCFG: correct base address computation for regions not starting at bus 0
Jan Beulich [Mon, 25 Jul 2011 15:42:19 +0000 (16:42 +0100)]
x86-64/MMCFG: correct base address computation for regions not starting at bus 0

As per the specification, the base address reported by ACPI is the one
that would be used if the region started at bus 0. Hence the
start_bus_number offset needs to be added not only to the virtual
address, but also the physical one when establishing the mapping, and
it then needs to be subtracted when obtaining the virtual address for
doing accesses.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoVT-d: always clean up dpci timers.
Tim Deegan [Mon, 25 Jul 2011 15:41:33 +0000 (16:41 +0100)]
VT-d: always clean up dpci timers.
Message-ID: <20110718163848.GD18276@whitby.uk.xensource.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)

If a VM has all its PCI devices deassigned, need_iommu(d) becomes
false but it might still have DPCI EOI timers that were init_timer()d
but not yet kill_timer()d.  That causes xen to crash later because the
linked list of inactive timers gets corrupted, e.g.:

(XEN) Xen call trace:
(XEN)    [<ffff82c480126256>] set_timer+0x1c2/0x24f
(XEN)    [<ffff82c48011fbf8>] schedule+0x129/0x5dd
(XEN)    [<ffff82c480122c1e>] __do_softirq+0x7e/0x89
(XEN)    [<ffff82c480122c9d>] do_softirq+0x26/0x28
(XEN)    [<ffff82c480153c85>] idle_loop+0x5a/0x5c
(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Assertion 'entry->next->prev == entry' failed at
/local/scratch/tdeegan/xen-unstable.hg/xen/include:172
(XEN) ****************************************

The following patch makes sure that the domain destruction path always
clears up the DPCI state even if !needs_iommu(d).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agohvmloader: Allow default response to be specified to xenstore_read().
Keir Fraser [Mon, 25 Jul 2011 13:21:13 +0000 (14:21 +0100)]
hvmloader: Allow default response to be specified to xenstore_read().

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agohvmloader: Formatting cleanups.
Keir Fraser [Mon, 25 Jul 2011 13:09:41 +0000 (14:09 +0100)]
hvmloader: Formatting cleanups.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agohvmloader: Replace bios_relocate hook with bios_load hook
Keir Fraser [Mon, 25 Jul 2011 12:57:49 +0000 (13:57 +0100)]
hvmloader: Replace bios_relocate hook with bios_load hook

Used by OVMF BIOS handler.

Signed-off-by: Bei Guan <gbtju85@gmail.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agofix regression from c/s 23735:537918f518ee
Jan Beulich [Mon, 25 Jul 2011 12:48:08 +0000 (13:48 +0100)]
fix regression from c/s 23735:537918f518ee

This was checking presence of the wrong (old) ELF note. I don't really
understand how this failed consistently only for one of the xen-boot
tests...

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agohvmloader: Declare get_hvm_info_table/get_shared_info as const funcs.
Keir Fraser [Sat, 23 Jul 2011 08:57:04 +0000 (09:57 +0100)]
hvmloader: Declare get_hvm_info_table/get_shared_info as const funcs.

The compiler can perform CSE on their call sites.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agohvmloader: Remove bogus and unused RESERVED_MEMSIZE decl.
Keir Fraser [Sat, 23 Jul 2011 08:56:13 +0000 (09:56 +0100)]
hvmloader: Remove bogus and unused RESERVED_MEMSIZE decl.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agohvmloader: New functions mem_hole_alloc() and mem_hole_populate_ram().
Keir Fraser [Sat, 23 Jul 2011 08:43:47 +0000 (09:43 +0100)]
hvmloader: New functions mem_hole_alloc() and mem_hole_populate_ram().

These can be used by BIOS-specific handlers to set up memory regions
as required by their firmware payload.

Use mem_hole_alloc() to allocate properly reserved space for the
shared-info-page mapping. The old location conflicts with space
required for the OVMF BIOS (support for which is work in progress).

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoxend: remove PCI device listing from NetBSD, since it's Linux
Roger Pau Monne [Sat, 23 Jul 2011 07:58:37 +0000 (08:58 +0100)]
xend: remove PCI device listing from NetBSD, since it's Linux
specific code.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
14 years agox86, mce: Dump mce log by ERST when mc panic
Liu, Jinsong [Sat, 23 Jul 2011 07:56:58 +0000 (08:56 +0100)]
x86, mce: Dump mce log by ERST when mc panic

We have implemented basic ERST logic before. Now linux3.0 as dom0 has
included APEI logic. Hence it's time to add mce apei interface and
enable APEI ERST feature.
With it, it can save mce log by ERST method when mc panic.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
14 years agoacpi: Add support for old and new bios erst, enable mce_apei logic
Liu, Jinsong [Sat, 23 Jul 2011 07:55:59 +0000 (08:55 +0100)]
acpi: Add support for old and new bios erst, enable mce_apei logic

When testing, we found different bios has different understanding
about APEI ERST table header, depending on whether it count ACPI
standard header or not.
This patch add support for both bios version, and enable mce_apei.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
14 years agoadd privileged (dom0) kernel feature indication
Jan Beulich [Sat, 23 Jul 2011 07:49:15 +0000 (08:49 +0100)]
add privileged (dom0) kernel feature indication

With our switching away from supporting 32-bit Dom0 operation, users
complained that attempts (perhaps due to lack of knowledge of that
change) to boot the no longer privileged kernel in Dom0 resulted in
apparently silent failure. To make the mismatch explicit and visible,
add dom0 feature flag that the kernel can set to indicate operation as
dom0 is supported.

Due to the way elf_xen_parse_features() worked up to now (getting
fixed here), adding features indications to the old, string based ELF
note would make the respective kernel unusable on older hypervisors.
For that reason, a new ELF Note is being introduced that allows
specifying supported features as a bit array instead (with features
unknown to the hypervisor simply ignored, as now also done by
elf_xen_parse_features(), whereas here unknown kernel-required
features still keep the kernel [and hence VM] from booting).

Introduce and use elf_note_numeric_array() to be forward
compatible (or else an old hypervisor wouldn't be able to parse kernel
specified features occupying more than 64 bits - thanks, Ian!).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agobuild: remove $(DESTDIR) from buildmakevars2file paths
Ian Campbell [Fri, 22 Jul 2011 07:55:19 +0000 (08:55 +0100)]
build: remove $(DESTDIR) from buildmakevars2file paths

23721:0ccb94d533d6 added this by mistake.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoAMD IOMMU: remove global interrupt remapping table
Wei Wang [Thu, 21 Jul 2011 13:37:47 +0000 (14:37 +0100)]
AMD IOMMU: remove global interrupt remapping table

...use per-device table instead.

This should work with per-cpu IDTs.  We are safe to remove global
table since SATA device id issue doee not appear in recent
production BIOS.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
14 years agoxen: Fix sedf scheduler
George Dunlap [Thu, 21 Jul 2011 13:35:31 +0000 (14:35 +0100)]
xen: Fix sedf scheduler

Update the sedf scheduler to be compatible with the most recent
generic scheduler interface changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agox86: add change missing in c/s 23726:fd97ca086df6
Jan Beulich [Thu, 21 Jul 2011 13:34:51 +0000 (14:34 +0100)]
x86: add change missing in c/s 23726:fd97ca086df6

The early "do we need to do anything" check needs adjustment, too.
Thanks to Haitao Shan for pointing this out.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agohvmloader: Switch to absolute addressing for calling hypercall stubs.
Keir Fraser [Wed, 20 Jul 2011 14:02:16 +0000 (15:02 +0100)]
hvmloader: Switch to absolute addressing for calling hypercall stubs.

This is clearer and less fragile than trying to make relative calls
work. In particular, the old approach failed if _start was not
== HVMLOADER_PHYSICAL_ADDRESS. This was the case for some modern
toolchains which reorder functions.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agohvmloader: Remove hard tabs from source files.
Keir Fraser [Wed, 20 Jul 2011 13:52:16 +0000 (14:52 +0100)]
hvmloader: Remove hard tabs from source files.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agolibxl: clean up trailing whitespaces in code.
Wei Liu [Tue, 19 Jul 2011 15:02:36 +0000 (16:02 +0100)]
libxl: clean up trailing whitespaces in code.

Commit exactly the results of running
   find \! -iname '*.txt' -type f -print0 | xargs -0 perl -p -i.bak -E 's/\s+\n/\n/'

Signed-off-by: Wei Liu <liuw@liuw.name>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed: Ian Jackson <ian.jackson@eu.citrix.com>

14 years agolibxl: enabling upstream qemu as pure pv backend.
Wei Liu [Tue, 19 Jul 2011 14:47:14 +0000 (15:47 +0100)]
libxl: enabling upstream qemu as pure pv backend.

This patch makes device_model_{version,override} work for pure pv
guest, so that users can specify upstream qemu as pure pv backend
other than traditional qemu-xen.

This patch also adds device_model_args_{pv,hvm} options for pv and
hvm guest respectively.

Internally, original libxl__create_xenpv_qemu allocates a new empty
dm_info (struct libxl_device_model_info) for every xenpv qemu created.
Now the caller of libxl__create_xenpv_qemu is responsible for
allocating this dm_info.

Signed-off-by: Wei Liu <liuw@liuw.name>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86: update Intel CPUID masking code to latest spec
Jan Beulich [Tue, 19 Jul 2011 13:14:51 +0000 (14:14 +0100)]
x86: update Intel CPUID masking code to latest spec

..., which adds masking of the xsave feature leaf.

Also add back (and fix to actually make it do what it was supposed to
do from the beginning) the printing of what specific masking couldn't
be done in case the user requested something the hardware doesn't
support.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoPCI: consolidate interface for adding devices
Jan Beulich [Tue, 19 Jul 2011 13:14:08 +0000 (14:14 +0100)]
PCI: consolidate interface for adding devices

The functionality of pci_add_device_ext() can be easily folded into
pci_add_device(), and eliminates the need to change two functions for
future adjustments.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: Remove timeouts from INIT-SIPI-SIPI sequence when using x2apic.
Tim Deegan [Tue, 19 Jul 2011 13:13:01 +0000 (14:13 +0100)]
x86: Remove timeouts from INIT-SIPI-SIPI sequence when using x2apic.

Some of the timeouts are pointless since they're waiting for the ICR
to ack the IPI delivery and that doesn't happen on x2apic.
The others should be benign (and are suggested in the SDM) but
removing them makes AP bringup much more reliable on some test boxes.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agox86: consistently serialize CMOS/RTC accesses on rtc_lock
Jan Beulich [Tue, 19 Jul 2011 13:10:53 +0000 (14:10 +0100)]
x86: consistently serialize CMOS/RTC accesses on rtc_lock

Since RTC/CMOS accesses aren't atomic, there are possible races
between code paths setting the index register and subsequently
reading/writing the data register. This is supposed to be dealt with
by acquiring rtc_lock, but two places up to now lacked respective
synchronization: Accesses to the EFI time functions and
smpboot_{setup,restore}_warm_reset_vector().

This in turn requires no longer directly passing through guest writes
to the index register, but instead using a machanism similar to that
for PCI config space method 1 accesses.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86-64/EFI: don't call EfiResetSystem() from machine_halt()
Jan Beulich [Tue, 19 Jul 2011 13:10:15 +0000 (14:10 +0100)]
x86-64/EFI: don't call EfiResetSystem() from machine_halt()

c/s 23615:d19e77844267 was a little too eager in adding calls to EFI
runtime services: machine_halt() doesn't really want to power off the
machine, but that's what EfiResetSystem(EfiResetShutdown, ...) (called
through efi_halt_system()) does.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agobuild: consolidate buildmakevars2file
Jan Beulich [Tue, 19 Jul 2011 13:09:48 +0000 (14:09 +0100)]
build: consolidate buildmakevars2file

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoAdding back guest MSI eoi support for unmaskable MSI interrupt
Shan Haitao [Tue, 19 Jul 2011 07:24:19 +0000 (08:24 +0100)]
Adding back guest MSI eoi support for unmaskable MSI interrupt

This patch adds back proper guest MSI EOI hook for correctly handling
unmaskable MSI interrupt, which is wrongly removed by changset 23703.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
14 years agoxentrace: update __trace_var comment
Olaf Hering [Tue, 19 Jul 2011 07:22:19 +0000 (08:22 +0100)]
xentrace: update __trace_var comment

Signed-off-by: Olaf Hering <olaf@aepfle.de>
14 years agolibxl: Keyed unions key off an enum instead of an arbitrary expression
Ian Campbell [Mon, 18 Jul 2011 13:52:30 +0000 (14:52 +0100)]
libxl: Keyed unions key off an enum instead of an arbitrary expression

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: use libxl_domain_type enum with libxl__domain_suspend_common
Ian Campbell [Mon, 18 Jul 2011 13:52:30 +0000 (14:52 +0100)]
libxl: use libxl_domain_type enum with libxl__domain_suspend_common

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: specify HVM vs PV in create_info using libxl_domain_type enum
Ian Campbell [Mon, 18 Jul 2011 13:52:30 +0000 (14:52 +0100)]
libxl: specify HVM vs PV in create_info using libxl_domain_type enum

Since libxl_init_build_info now needs an error return and a ctx (to
log to) switch all libxl_init_*_info to have an int return and a ctx.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: specify HVM vs PV in build_info using libxl_domain_type enum
Ian Campbell [Mon, 18 Jul 2011 13:52:30 +0000 (14:52 +0100)]
libxl: specify HVM vs PV in build_info using libxl_domain_type enum

Also caught one place (in libxl__domain_restore_common) which used
info->u.hvm.pae even if !hvm. (fortunately the value was unused in
xc_domain_restore).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: replace libxl__domain_is_hvm with libxl__domain_type
Ian Campbell [Mon, 18 Jul 2011 13:52:30 +0000 (14:52 +0100)]
libxl: replace libxl__domain_is_hvm with libxl__domain_type

New function returns a libxl_domain_type enum.

Add LIBXL__DOMAIN_IS_TYPE helper macro.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: Give the HVM domain type the name "HVM"
Ian Campbell [Mon, 18 Jul 2011 13:52:29 +0000 (14:52 +0100)]
libxl: Give the HVM domain type the name "HVM"

This is generally used in the Xen universe, rather than "FV" which is
not used elsewhere.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agoxend NetBSD init script: fixed problem when restarting xend
Roger Pau Monne [Mon, 18 Jul 2011 13:38:31 +0000 (14:38 +0100)]
xend NetBSD init script: fixed problem when restarting xend

When restarting xend, the rc.d script was unable to find the pid of
the running xend, so no process was restarted.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoefi: include irq.h to fix compile error in runtime.c
Olaf Hering [Sat, 16 Jul 2011 08:25:48 +0000 (09:25 +0100)]
efi: include irq.h to fix compile error in runtime.c

runtime.c: In function 'efi_rs_enter':
runtime.c:45:5: error: implicit declaration of function 'irq_enter'
[-Werror=implicit-function-declaration]
runtime.c:45:5: error: nested extern declaration of 'irq_enter'
[-Werror=nested-externs]
runtime.c: In function 'efi_rs_leave':
runtime.c:75:5: error: implicit declaration of function 'irq_exit'
[-Werror=implicit-function-declaration]
runtime.c:75:5: error: nested extern declaration of 'irq_exit'
[-Werror=nested-externs]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
14 years agoxentrace: reduce size of extradata in trace_irq_mask()
Olaf Hering [Sat, 16 Jul 2011 08:24:43 +0000 (09:24 +0100)]
xentrace: reduce size of extradata in trace_irq_mask()

Reduce size of extra_data in to avoid possible crash in trace_var.

(XEN) Assertion 'extra_word <= TRACE_EXTRA_MAX' failed at trace.c:687
(XEN) Xen call trace:
(XEN)    [<ffff82c480128783>] __trace_var+0x4d/0x3b8
(XEN)    [<ffff82c480162172>] trace_irq_mask+0x49/0x4b
(XEN)    [<ffff82c4801631ae>] __assign_irq_vector+0x241/0x374
(XEN)    [<ffff82c48015d813>] set_desc_affinity+0x5d/0xd4
(XEN)    [<ffff82c480160708>] set_msi_affinity+0x44/0x1c1
(XEN)    [<ffff82c480162938>] move_masked_irq+0x9c/0xcd
(XEN)    [<ffff82c4801629a7>] move_native_irq+0x3e/0x53
(XEN)    [<ffff82c48015d969>] ack_msi_irq+0x2c/0x6e
(XEN)    [<ffff82c4801622e3>] do_IRQ+0x16f/0x66d

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agohvm: remove cast from trace_var call for HVMOP_xentrace
Olaf Hering [Sat, 16 Jul 2011 08:24:03 +0000 (09:24 +0100)]
hvm: remove cast from trace_var call for HVMOP_xentrace

trace_var() takes a void pointer, casting is not needed.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agonestedsvm: Support TSC Rate MSR
Christoph Egger [Sat, 16 Jul 2011 08:23:22 +0000 (09:23 +0100)]
nestedsvm: Support TSC Rate MSR

Support TSC Rate MSR and enable TSC scaling for
nested virtualization.

With it, guest VMs don't need take #VMEXIT to calculate a translated
TSC value when it is running under TSC emulation mode.

I measured native performance of the rdtsc instruction
in the l2 guest with xen-on-xen and both host and
and l1 guest run under TSC emulation mode.

TSC scaling just needs MSR emulation and correct tsc offset
calculation to be done and thus can be emulated also on older
hardware. In this case rdtsc instruction is intercepted and
handled by the host directly and safes the cost of a full
VMRUN/VMEXIT emulation cycle.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agolibxc: remove obsolete comment.
Ian Campbell [Sat, 16 Jul 2011 08:18:45 +0000 (09:18 +0100)]
libxc: remove obsolete comment.

Seems to predate Xen 3.0...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agox86: fix guest migration after c/s 20892:d311d1efc25e
Jan Beulich [Sat, 16 Jul 2011 08:18:21 +0000 (09:18 +0100)]
x86: fix guest migration after c/s 20892:d311d1efc25e

Guests would not manage to run successfully after being migrated to a
host having sufficiently much more memory than the host they were
originally started on.

Subsequently the plan is to re-enable the changes behavior under the
control of a guest kernel announced feature flag.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years ago[IA64] Fix ia64 build for 22396:c1b7aae86cf5
KUWAMURA Shin'ya [Sat, 16 Jul 2011 08:17:20 +0000 (09:17 +0100)]
[IA64] Fix ia64 build for 22396:c1b7aae86cf5

The header xen/include/xen/wait.h conflicts with
xen/include/asm-ia64/linux/wait.h on ia64.
This patch fixes it.

# xen/include/xen/wait.h introduced by 22396:c1b7aae86cf5.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years ago[IA64] fix warning: "in_atomic" redefined
KUWAMURA Shin'ya [Sat, 16 Jul 2011 08:16:48 +0000 (09:16 +0100)]
[IA64] fix warning: "in_atomic" redefined

This patch fixes `warning: "in_atomic" redefined'.
# It is introduced by 22395:deb438d43e79.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agoxen/irq: Make it obvious that desc->status fields comprise a bitfield.
Keir Fraser [Sat, 16 Jul 2011 08:15:56 +0000 (09:15 +0100)]
xen/irq: Make it obvious that desc->status fields comprise a bitfield.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoRemove MSI IRQ storms prevention logic
Shan Haitao [Sat, 16 Jul 2011 08:12:19 +0000 (09:12 +0100)]
Remove MSI IRQ storms prevention logic

The reason is:
1. The logic has negative impact on 10G NIC performance (assigned to
guest) by lowering the interrupt frequency that Xen can handle.
2. Xen already has IRQ rate limit logic, which can also help to
prevent IRQ storms.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
14 years agoxen/libxc: Clean up pv_cpuid switch statements.
Keir Fraser [Sat, 16 Jul 2011 08:09:46 +0000 (09:09 +0100)]
xen/libxc: Clean up pv_cpuid switch statements.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoxen/libxc: set CPUID topology leaf as unsupported for PV guests
David Vrabel [Sat, 16 Jul 2011 08:05:45 +0000 (09:05 +0100)]
xen/libxc: set CPUID topology leaf as unsupported for PV guests

The result of a CPUID Extended Topology Enumeration leaf for PV guests
is invalid as the level in ECX is ignored.  This can cause some guests
to loop endlessly when trying to enumerate the topology.

Since the physical topology isn't useful to PV guests set the topology
leaf as unsupported.

Guests affected include Linux kernels prior 2.6.32 where a workaround
was applied ("xen: mask extended topology info in cpu",
82d6469916c6fcfa345636a49004c9d1753905d1).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
14 years agotools: xencommons NetBSD init script: Multiple bugfixes and improvements
Roger Pau Monne [Fri, 15 Jul 2011 17:22:03 +0000 (18:22 +0100)]
tools: xencommons NetBSD init script: Multiple bugfixes and improvements

Added a cleanup of the xenstore database, to purge old entries,
prevented the restart of xenstore and set Domain-0 name.  Also
replaced the sleep 5 (wait for xenstore to come up) with the method
used in the linux init script.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl: log domain suspension.
Ian Campbell [Fri, 15 Jul 2011 17:13:28 +0000 (18:13 +0100)]
xl: log domain suspension.

Other shutdown reasons all end up saying something useful while
suspend does not. With this patch the log looks like:
  Domain 670 is dead
  Domain has suspended.
  Done. Exiting now

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agopygrub: prefer Grub2 to Grub1
Ian Campbell [Fri, 15 Jul 2011 17:12:55 +0000 (18:12 +0100)]
pygrub: prefer Grub2 to Grub1

If a VM image has grub2 installed it is likely the one we need to be using.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxenbackendd: fix mistaken treatment of unknown backend (eg console) as VIF/VBD
Roger Pau Monne [Fri, 15 Jul 2011 17:09:49 +0000 (18:09 +0100)]
xenbackendd: fix mistaken treatment of unknown backend (eg console) as VIF/VBD

Fixed a cleanup of a variable used in a loop and added a debug message.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: add LIBXL_MAC_{FMT,FMTLEN,BYTES}
Ian Campbell [Thu, 14 Jul 2011 12:24:19 +0000 (13:24 +0100)]
libxl: add LIBXL_MAC_{FMT,FMTLEN,BYTES}

Modelled after LIBXL_UUID_... (where I also add FMTLEN).

signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: rename testenum->testidl
Ian Campbell [Thu, 14 Jul 2011 12:24:11 +0000 (13:24 +0100)]
libxl: rename testenum->testidl

I plan to add some non-Enumeration tests.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: IDL: bring command line handling in genwrap.py into one place.
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: bring command line handling in genwrap.py into one place.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: IDL: add helper to generate references to Aggregate type members.
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: add helper to generate references to Aggregate type members.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: IDL: remove libxl_C_type_of
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: remove libxl_C_type_of

It's not really adding much...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: IDL: refactor code to massage a type into a function argument
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: refactor code to massage a type into a function argument

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: IDL: handle generation of pass-by-reference arguments.
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: handle generation of pass-by-reference arguments.

Up until now everything with a destructor function happened to be
pass-by-reference so the current code worked but this will not be the case for
*_to_string and *_to_json. Put some infrastructure in place and use it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agolibxl: IDL: s/anonynous/anonymous/
Ian Campbell [Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)]
libxl: IDL: s/anonynous/anonymous/

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agobuild: define "move-if-changed" make macro.
Ian Campbell [Thu, 14 Jul 2011 12:22:35 +0000 (13:22 +0100)]
build: define "move-if-changed" make macro.

Use it to replace various places which (should) use the
if ! cmp -s ...; then mv ....; fi
pattern.

Also add an else clause to cleanup the unchanged temporary file.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
14 years agotools/pygrub: fix solaris kernel sniff
tools/pygrub: fix solaris kernel sniff [Thu, 14 Jul 2011 17:09:58 +0000 (18:09 +0100)]
tools/pygrub: fix solaris kernel sniff

Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the
64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists.

This patch fixes the detection.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Frank Che <frank.che@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Fix segfault in get_all_assigned_devices
Stefano Stabellini [Thu, 14 Jul 2011 14:49:49 +0000 (15:49 +0100)]
libxl: Fix segfault in get_all_assigned_devices

pcidevs is an array of ndev elements (ndev is the number of pci devices
assigend to a specific domain), but we access pcidevs + *num
where *num is the global number of pci devices assigned so far to all
domains in the system.

Fix the issue removing pcidevs and just realloc'ing *list every time we
want to add a new pci device to the array.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agons16550: Clean up code style
Keir Fraser [Thu, 14 Jul 2011 08:43:37 +0000 (09:43 +0100)]
ns16550: Clean up code style

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoPlaceholder for V4V hypercall and VIRQ numbers
Ross Philipson [Thu, 14 Jul 2011 08:35:40 +0000 (09:35 +0100)]
Placeholder for V4V hypercall and VIRQ numbers

The V4V Xen functionality is currently in our product trees for
XenClient b= ut is not yet in a state suitable for submission. We hope
to make available= the rest of the V4V functionality in the not too
distant future. Since the= se values are already in use in our
product, we would like to reserve them = in open source to prevent
issues or incompatibilities down the road.

Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
14 years agodocs: correct typo in vbd-interface.txt
Ian Campbell [Thu, 14 Jul 2011 08:33:38 +0000 (09:33 +0100)]
docs: correct typo in vbd-interface.txt

d1 is xvdb not xvda.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agomerge
Keir Fraser [Thu, 14 Jul 2011 08:33:02 +0000 (09:33 +0100)]
merge

14 years agodoc: Update the com1,com2 section with pci and amt options.
Konrad Rzeszutek Wilk [Thu, 14 Jul 2011 08:31:53 +0000 (09:31 +0100)]
doc: Update the com1,com2 section with pci and amt options.

The "xen: Automatically find serial port on PCI/PCIe and AMT devices."
provides the functionality to probe for the I/O base using the
"pci" and "amt" option. Update the documentation with this fact.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
14 years agoxen: Update pci_uart_config to save the BAR1 contents if com2 is used
Konrad Rzeszutek Wilk [Thu, 14 Jul 2011 08:31:12 +0000 (09:31 +0100)]
xen: Update pci_uart_config to save the BAR1 contents if com2 is used

Jan Beulich pointed out that the pci_uart_config can be called for
com2 and we should probe the second BAR instead of the first one.

This patch will probe the BAR0 if it is com1, and BAR1 if its com2.
It also cleans up some of the whitespace problems and changes the
name of the parameter and function from 'magic' to 'pci'.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
14 years agoxen: Restore the BAR and PCI command after resume.
Konrad Rzeszutek Wilk [Thu, 14 Jul 2011 08:30:25 +0000 (09:30 +0100)]
xen: Restore the BAR and PCI command after resume.

Certain PCI serial cards just don't want to remember
what they are when they come out of resume. Save
the BAR and the PCI command values before we suspend and
write them back in when we resume.

Signed-off-by: Roger Cruz <roger.cruz@virtualcomputer.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
14 years agoxen: Automatically find serial port on PCI/PCIe and AMT devices.
James Mckenzie [Thu, 14 Jul 2011 08:28:23 +0000 (09:28 +0100)]
xen: Automatically find serial port on PCI/PCIe and AMT devices.

Instead of having to manually look the right I/O port on the PCI
devices or AMT devices, lets probe the card and find that
automatically.

This means that you don't have to have this:
 com1=115200,8n1,0xd800,0

But instead can have
 com1=115200,8n1,magic

Or if you have AMT:
 com1=19200,8n1,amt

Signed-off-by: James Mckenzie <jamesmck@bob.uk.xensource.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>